﻿using System;
using System.Data;
using DotNetNuke;
using DotNetNuke.Framework;
using DNNToolkit.Common;

namespace DNNToolkit.Modules.CityTaxLocator.Components
{
    public abstract class DataProvider : TransDataProvider
    {

        #region "static Methods"

        private static DataProvider objProvider = null;

        // Constructor
        static DataProvider()
        {
            CreateProvider();
        }

        // Create provider
        private static void CreateProvider()
        {
            objProvider = (DataProvider)Reflection.CreateObject("data", "DNNToolkit.Modules.CityTaxLocator.Components", "");
        }

        // Instance for DAL Provider
        public static DataProvider Instance()
        {
            return objProvider;
        }

        #endregion

        #region "Methods for DNNToolkit_CityTax table"
        public abstract IDataReader SearchCityTaxByCity(string state, string city);
        public abstract IDataReader SearchCityTaxByCode(string localCD);
        public abstract IDataReader SearchCityTaxStates();
        public abstract IDataReader GetAllCityTax();
        public abstract IDataReader GetCityTaxByID(long cityTaxID);
        public abstract int SearchCityTaxCount();


        public abstract void CreateCityTax(string state, string localName, string locRate, string schlRate,
            string whRate, string w2Name, string localCD, string resInd, 
            string countyName, string additionalJur,string comments);

        public abstract void UpdateCityTaxById(long citytaxid, string state, string localName, string locRate,
            string schlRate,string whRate, string w2Name, string localCD,
            string resInd, string countyName, string additionalJur,string comments);
        public abstract void DeleteCityTax();
        public abstract void DeleteCityTaxByID(long cityTaxID);
        #endregion

        #region "Methods for DNNToolkit_CityTaxComment table"
        public abstract IDataReader SearchCityTaxComment();
        public abstract void CreateCityTaxComment(DateTime lastUpdate, string additionComment);
        public abstract void DeleteCityTaxComment();
        #endregion
    }
}
